Skip to content

Add configurable creature base stat max value#755

Open
Green00101 wants to merge 2 commits intoPokemonWorkshop:developfrom
Green00101:fix/base-stat-limit
Open

Add configurable creature base stat max value#755
Green00101 wants to merge 2 commits intoPokemonWorkshop:developfrom
Green00101:fix/base-stat-limit

Conversation

@Green00101
Copy link
Copy Markdown

Thank you for your contribution to the Pokémon Studio repo.

Before submitting this PR into the develop branch, please make sure:

  • Your code builds clean without any errors or warnings
  • You are following the Code guidelines
  • You tested your code to make sure it does what it is supposed to do

Description

Fixes #741

This PR adds a configurable creature base stat limit, with a default maximum value of 999.

Main changes:

  • Added baseStatMaxValue to the project settings configuration.
  • Added a default value of 999 for the maximum base stat value.
  • Added a migration to update existing project settings with the new field.
  • Updated the creature stats editor to validate base stats against the configured maximum value.
  • Added a non-blocking warning when a base stat is above the recommended 255 value.
  • Added i18n entries for the new setting, warning message, and migration label.

Note before testing

Existing projects should be migrated automatically. After migration, baseStatMaxValue should be added to the project settings with the default value of 999.

Tests to perform

Sorry, I’m not sure what I should put here.
I tested this change with both a newly created project and an existing project, and both worked as expected.

1 2 3

Thank you for taking the time to review this PR.
I am still learning, so any feedback is welcome. I am happy to update the code if changes are needed.

Copy link
Copy Markdown
Collaborator

@Aelysya Aelysya left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello, thanks a lot for your contribution, I've tested and it seems to work fine 😄.

I've left some review comments, just some quick things you could have hardly known since it's your first contribution here so no big deal, great job 😄.

Comment thread assets/i18n/fr.json Outdated
Comment thread src/migrations/addBaseStatMaxValueToSettings.ts
Comment thread src/migrations/migrationConfig.ts Outdated
@Green00101
Copy link
Copy Markdown
Author

Thank you for the review!

  • Updated the French translations.
  • Changed the migration version to 2.9.1.
  • Updated the previous settings migrations to account for baseStatMaxValue when migrating older projects.

Please let me know if there is anything else I need to change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Creatures base stat limits can now be extended

2 participants